package org.apache.dolphinscheduler.api.service.impl;

import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ResourceApplyService;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.dao.entity.ResourceApply;
import org.apache.dolphinscheduler.dao.mapper.ResourceApplyMapper;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 超算资源申请表 服务实现类
 * </p>
 *
 * @author denggh
 * @since 2023-10-18
 */
@Service
public class ResourceApplyServiceImpl extends BaseServiceImpl implements ResourceApplyService {

    @Autowired
    private ResourceApplyMapper resourceApplyMapper;

    @Override
    public Map<String, Object> insertResourceApply(ResourceApply resourceApply) {
        Map<String, Object> result = new HashMap<>();
        int insert = resourceApplyMapper.insert(resourceApply);
        if (insert > 0) {
            result.put(Constants.DATA_LIST, resourceApply);
            putMsg(result, Status.SUCCESS);
        }
        return result;
    }
}
